package com.weilai.common.service;

import com.weilai.common.dao.MedalRecordMapper;
import com.weilai.common.model.MedalRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Song on 2017/6/6.
 */
@Service
public class MedalRecordService {
    @Autowired
    MedalRecordMapper medalRecordMapper;

    public List<MedalRecord> findByUser(MedalRecord medalRecord) {
        return medalRecordMapper.selectByUser(medalRecord);
    }



    public void updateByUserId(MedalRecord medalRecord) {
        medalRecordMapper.updateByUserId(medalRecord);
    }

    public MedalRecord findByUserOfMedalRecordCount(MedalRecord medalRecord) {
        return medalRecordMapper.findByUserOfMedalRecordCount(medalRecord);
    }

    public void addMedalCount(MedalRecord medalRecord) {
        medalRecordMapper.insert(medalRecord);
    }


    public void saveByUserOfMedalCount(MedalRecord medalRecord) {
         medalRecordMapper.saveByUserOfMedalCount(medalRecord);
    }

}
